﻿package modular.module {
	import flash.events.ProgressEvent;
	
	import ch.sfug.log.Logger;
	import ch.sfug.net.loader.MediaLoader;
	import ch.sfug.net.loader.QueueLoader;
	
	import modular.Modular;		

	/**
	 * @author mich
	 */
	public class PreloaderModule extends Module {
		
		public function PreloaderModule( ) {
			super();
		}

		public function libraryProgress( pe:ProgressEvent ):void {
			Logger.log( pe, Modular.LOG_INFO );
		}
		
		public function queueProgress( pe:ProgressEvent ):void {
			var queue:QueueLoader = QueueLoader( pe.target);
			var ml:MediaLoader = MediaLoader( queue.loaders[ pe.bytesLoaded - 1 ] );
			Logger.log( "loaded: " + ml.request.url, Modular.LOG_INFO);
		}
	}
}
